package com.xyht.sca_s.student_manage_system.modules.bigData.controller;

import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.bigData.service.SmsEnrolStudentInfoService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * <p>
 *  大数据驾驶舱-校园总览-招生信息 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2023-08-31
 */
@RestController
@RequestMapping("/bigData/enrolStudent")
@SecretBody
public class SmsEnrolStudentInfoController {

    @Resource
    private SmsEnrolStudentInfoService smsEnrolStudentInfoService;

    @ApiModelProperty("招生信息")
    @GetMapping("/getEnrolStudent")
    public ResponseResult getEnrolStudent(@RequestParam(value = "thisYear",required = false) String thisYear){
        return smsEnrolStudentInfoService.getEnrolStudent(thisYear);
    }

    @ApiModelProperty("民族分布")
    @GetMapping("/getNationDistribution")
    public ResponseResult getNationDistribution(){
        return smsEnrolStudentInfoService.getNationDistribution();
    }

    @ApiModelProperty("各出生年段数")
    @GetMapping("/getBirthDistribution")
    public ResponseResult getBirthDistribution(){
        return smsEnrolStudentInfoService.getBirthDistribution();
    }

    @ApiModelProperty("各学院男女占比")
    @GetMapping("/getCollegeBoyAndGirlRation")
    public ResponseResult getCollegeBoyAndGirlRation(){
        return smsEnrolStudentInfoService.getCollegeBoyAndGirlRation();
    }

    @ApiModelProperty("历年招生总数+男女生总数")
    @GetMapping("/getBoyAndGirlSum")
    public ResponseResult getBoyAndGirlSum(@RequestParam(value = "beginTimeStr",required = false) String beginTimeStr,
                                           @RequestParam(value = "endTimeStr",required = false) String endTimeStr){
        return smsEnrolStudentInfoService.getBoyAndGirlSum(beginTimeStr,endTimeStr);
    }

}
